import axios from "../axios";

const epidemicrisk = {
  porjectper: async function (
    params,
    userId,
    cardNum,
    unitName,
    phoneNum,
    end,
    start,
    name
  ) {
    return await axios({
      method: "post",
      url:
        "/preventionOverview/details/getPrjUser?userId=" +
        userId +
        "&cardNum=" +
        cardNum +
        "&unitName=" +
        unitName +
        "&phoneNum=" +
        phoneNum +
        "&end=" +
        end +
        "&start=" +
        start +
        "&name=" +
        name,
      data: params
    });
  },
  projectkaoqin: async function (
    params,
    userId,
    end,
    start,
    iswork,
    name,
    personalHealth,
    subProjectId
  ) {
    return await axios({
      method: "post",
      url:
        "/preventionOverview/details/getPrjWork?userId=" +
        userId +
        "&end=" +
        end +
        "&isWork=" +
        iswork +
        "&name=" +
        name +
        "&personalHealth=" +
        personalHealth +
        "&start=" +
        start +
        "&subProjectId=" +
        subProjectId,
      data: params
    });
  },
  builderskaoqin: async function (
    params,
    userId,
    end,
    start,
    iswork,
    name,
    personalHealth,
    subProjectId
  ) {
    return await axios({
      method: "post",
      url:
        "/preventionOverview/details/getConWork?userId=" +
        userId +
        "&end=" +
        end +
        "&isWork=" +
        iswork +
        "&name=" +
        name +
        "&personalHealth=" +
        personalHealth +
        "&start=" +
        start +
        "&subProjectId=" +
        subProjectId,
      data: params
    });
  },
  //饼图
  projectkaoqinpie: async function (userId) {
    return await axios({
      method: "get",
      url: "/preventionOverview/report/getChartPrjSign?userId=" + userId
    });
  },
  //饼图
  projectepidemicriskpie: async function (userId) {
    return await axios({
      method: "get",
      url: "/preventionOverview/report/getChartPrjPren?userId=" + userId
    });
  },
  //查询所有的父项目
  projectinfo: async function () {
    return await axios({
      method: "get",
      url: "/parentProj/select"
    });
  },
  //通过父项目ID查子项目列表
  findchildbyid: async function (id, num, size) {
    return await axios({
      method: "get",
      url: "/subProj/listAll?id=" + id + "&pageNum=" + num + "&pageSize=" + size
    });
  },
  //用户查询施工方考勤概览
  builderskaoqinbyid: async function (current, size, userid) {
    return await axios({
      method: "post",
      url:
        "conEpidemic/constConditions?current=" +
        current +
        "&size=" +
        size +
        "&userId=" +
        userid
    });
  },

  //用户查询项目方考勤概览
  projectkaoqinbyid: async function (current, size, userid) {
    return await axios({
      method: "post",
      url:
        "/workInfo/proWorkInfoPage?current=" +
        current +
        "&size=" +
        size +
        "&userId=" +
        userid
    });
  },
  //父项目id查询父项目信息
  findparentbyid: async function (id) {
    return await axios({
      method: "get",
      url: "/parentProj/list/" + id
    });
  },
  //项目方考勤概览
  porjectkaoqingailan: async function (current, size, id) {
    return await axios({
      method: "post",
      url:
        "/workInfo/projectConditions?current=" +
        current +
        "&size=" +
        size +
        "&userId=" +
        id
    });
  },
  //详情查询子项目下拉
  findchildlist: async function (userid) {
    return await axios({
      method: "post",
      url: "/subProj/findUserSubProject/" + userid
    });
  }
};
const porjectper = epidemicrisk.porjectper;
const projectkaoqin = epidemicrisk.projectkaoqin;
const builderskaoqin = epidemicrisk.builderskaoqin;
const projectkaoqinpie = epidemicrisk.projectkaoqinpie;
const projectepidemicriskpie = epidemicrisk.projectepidemicriskpie;
const projectinfo = epidemicrisk.projectinfo;
const findchildbyid = epidemicrisk.findchildbyid;
const builderskaoqinbyid = epidemicrisk.builderskaoqinbyid;
const projectkaoqinbyid = epidemicrisk.projectkaoqinbyid;
const findparentbyid = epidemicrisk.findparentbyid;
const porjectkaoqingailan = epidemicrisk.porjectkaoqingailan;
const findchildlist = epidemicrisk.findchildlist;
export {
  porjectper,
  projectkaoqin,
  builderskaoqin,
  projectkaoqinpie,
  projectepidemicriskpie,
  projectinfo,
  findchildbyid,
  builderskaoqinbyid,
  projectkaoqinbyid,
  findparentbyid,
  porjectkaoqingailan,
  findchildlist
};
